package com.example.hostsys.util;

import lombok.Data;
import org.springframework.stereotype.Component;

@Data
public class ResultSet {
    private Integer code;
    private Object data;
    private ResultSet(Integer state,Object data) {
        this.code = state;
        this.data = data;
    }
    public static ResultSet build(Object object) {
        return new ResultSet(200, object);
    }
    public static ResultSet success() {
        return new ResultSet(200, "success");
    }
    public static ResultSet errorMsg(Object object) {
        return new ResultSet(401, object);
    }
    public static ResultSet fail() {
        return new ResultSet(400, null);
    }
}
